package com.swyc.osschat.Test.designMode.memorandum.vo;

/**
 * @description 发起人角色：实体类
 * @Author: z156940l@outlook.com
 * @className DataBean
 * @Date: 2022/6/27 16:00
 */
public class DataBean {
    private String data;

    public DataBean(String data) {
        this.data = data;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    //通过备忘录保存
    public Memento saveState(){
        return new Memento(data);
    }

    //通过备忘录恢复
    public void recoverState(Memento memento){
        this.data = memento.getData();
    }

    @Override
    public String toString() {
        return "DataBean{" +
                "data='" + data + '\'' +
                '}';
    }
}
